/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package sopraim.presenter.validate;

import sopraim.entity.User;
import sopraim.exceptions.UserExcepion;

/**
 *
 * @author thomas
 */
public class UserCheckForm {
    
    public UserCheckForm(User user) throws Exception{
        if (user==null)
            throw(new UserExcepion("User is null"));
        if (user.getUsername()==null || user.getUsername().isEmpty())
            throw(new UserExcepion("User's username is null or empty"));
        if (user.getPassword()==null || user.getPassword().isEmpty())
            throw(new UserExcepion("User's password is null or empty"));
    }
}
